package com.situ.crm.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.situ.crm.common.ServerResponse;
import com.situ.crm.entity.CusDevPlan;
import com.situ.crm.mapper.CusDevPlanMapper;
import com.situ.crm.service.ICusDevPlanService;

@Service
public class CusDevPlanServiceImpl implements ICusDevPlanService {

	@Autowired
	private CusDevPlanMapper cusDevPlanMapper;

	@Override
	public ServerResponse list(Integer id) {
		List<CusDevPlan> list = cusDevPlanMapper.list(id);
		System.out.println("impl = " + list);
		return ServerResponse.createSuccess("成功", list);
	}

	@Override
	public ServerResponse insert(CusDevPlan cusDevPlan ) {
		Integer count = cusDevPlanMapper.insertSelective(cusDevPlan);
		if (count == 1) {
			return ServerResponse.createSuccess("添加成功");
		}else {
			return ServerResponse.createSuccess("添加失败");
		}
	}

}
